package test3;

import test2.ValidateYea;

import java.util.Scanner;

public class ValidateYear {
    public static void main(String[] args) {
        ValidateYear v=new ValidateYear();
        Scanner sc=new Scanner(System.in);
        System.out.println("请用户输入一个年份");
        int years=sc.nextInt();
        v.ValidateYear(years);
        if (v.ValidateYear(years)){
            System.out.println("是闰年");
        }else{
            System.out.println("是平年");
        }
    }

    public boolean ValidateYear(int years){
        boolean flag=false;
        if (years%4==0&&years%100!=0||years%400==0){
            flag=true;
        }
        return flag;
    }
}
